package com.ruoyi.web.controller.cs;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.cs.domain.vo.FXPayNotifyParam;
import com.ruoyi.cs.service.IFUXINPayService;
import com.ruoyi.cs.service.IJiuJiaPayService;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;


/**
 * 九嘉充值
 *
 * @author ruoyi
 * @date 2021-03-25
 */
@RestController
@RequestMapping("/cs/jjiapay")
@Api(tags = {"九嘉充值记录管理"})
public class JJPayController {
    private static final Logger log = LoggerFactory.getLogger(JJPayController.class);

    @Autowired
    private IJiuJiaPayService jiuJiaPayService;

    @PostMapping("/jjiaPayNotify")
    @Log(title = "九嘉充值异步回调", businessType = BusinessType.OTHER)
    public String jjiaPayNotify(HttpServletRequest request) {
        try {
            return jiuJiaPayService.notify(request);
        } catch (Exception e) {
            log.error("富信支付异步通知异常:{},参数:{}", e.getMessage());
            return "fail";
        }
    }
}
